package cn.zxy.mapper;

import cn.zxy.model.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface IuserMapper {
    @Select("select * from user")
    public List<User> findAll();

    public User findById(Integer id);

    @Insert("insert into user values(#{id},#{username},#{sex},#{address},#{birthday})")
    public void save(User user);

    @Update("update user set username=#{username},sex=#{sex},address=#{address} where id=#{id}")
    void update(User user);

    @Delete("delete from user where id=#{id}")
    void delete(int id);
}
